<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:p="http://primefaces.org/ui" 
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:c="http://java.sun.com/jsp/jstl/core">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</h:head>
<h:body>
	<ui:composition template="template.xhtml">

		<ui:define name="title">mehmet emmy</ui:define>
		<ui:define name="body">
			<c:if test="${sessionScope.currentKullanici.grup != 2}">
				<script language="javascript">
                    	alert("bu sayfaya erişim yetkiniz yoktur.")
    					redirectPage();
	  	 			</script>
			</c:if>
			<h:form id="temsilciProDetay" acceptcharset="UTF-8">
				<p:growl id="temProDetayGrowl" sticky="true" showDetail="true"
					life="3000" />

				<p:wizard widgetVar="wiz" showStepStatus="true" showNavBar="true">

					<p:tab id="personal" title="Personal">

						<p:panel header="Personal Details" id="person">

							<h:messages errorClass="error" 
								style="color: red; font-style: italic; text-decoration: blink" />

							<h:panelGrid columns="2" columnClasses="label, value"
								styleClass="grid">
								
								<h:outputText value="Tc Kimlik: *"/>
								<p:inputText label="TcKimlik" disabled="true"
									value="#{TemsilciBean.currentTemsilci.tcKimlik}"
									style="color:red;" />															
																	
									
								<h:outputText value="İsim: *" />
								<p:inplace id="isim" editor="true">
									<p:inputText required="true" label="isim"
										value="#{TemsilciBean.currentTemsilci.ad}" />
								</p:inplace>
								
								<h:outputText value="soyisim: *" />
								<p:inplace id="soyad" editor="true">
									<p:inputText required="true" label="soyisim"
										value="#{TemsilciBean.currentTemsilci.soyad}" />
								</p:inplace>

								<h:outputText value="Doğum Tarihi: " />
								<p:inplace id="dgTarih" editor="true">
									<p:inputMask required="true" label="dogumTarihi"
										mask="99/99/9999"
										value="#{TemsilciBean.currentTemsilci.dogumTarihi}" />
								</p:inplace>
								
								<h:outputText value="Ünvan: *" />
								<p:inplace id="unvan" editor="true">
									<p:inputText required="true" label="unvan"
										value="#{TemsilciBean.currentTemsilci.unvan}" />
								</p:inplace>
							</h:panelGrid>
						</p:panel>
					</p:tab>

					<p:tab id="address" title="Address">
						<p:panel header="Adress Details">

							<h:messages errorClass="error"
								style="color: red; font-style: italic; text-decoration: blink" />

							<h:panelGrid columns="2" columnClasses="label, value">
								<h:outputText value="il : " />
								<p:inplace id="il" editor="true">
									<p:inputText value="#{TemsilciBean.currentTemsilci.adres.il}"
										required="true" requiredMessage="il boş bırakılamaz" />
								</p:inplace>
							
								<h:outputText value="ilçe : " />
								<p:inplace id="ilce" editor="true">
									<p:inputText value="#{TemsilciBean.currentTemsilci.adres.ilce}"
										required="true" requiredMessage="ilçe boş bırakılamaz" />
								</p:inplace>
							
								<h:outputText value="Mahalle : " />
								<p:inplace id="mahalle" editor="true">
									<p:inputText value="#{TemsilciBean.currentTemsilci.adres.mahalle}"
										required="true" requiredMessage="Mahalle boş bırakılamaz" />
								</p:inplace>
								
								<h:outputText value="Sokak : " />
								<p:inplace id="sokak" editor="true">
									<p:inputText value="#{TemsilciBean.currentTemsilci.adres.sokak}"
										required="true" requiredMessage="Sokak boş bırakılamaz" />
								</p:inplace>
								
								<h:outputText value="Numara : " />
								<p:inplace id="numara" editor="true">
									<p:inputText value="#{TemsilciBean.currentTemsilci.adres.numara}"
										required="true" requiredMessage="Numara boş bırakılamaz" />
								</p:inplace>
								
							</h:panelGrid>
						</p:panel>
					</p:tab>

					<p:tab id="contact" title="Contact">
						<p:panel header="Contact Information">

							<h:messages errorClass="error" 
								style="color: red; font-style: italic; text-decoration: blink"/>

							<h:panelGrid columns="2" columnClasses="label, value">
								
								<h:outputText value="Email : " />
								<p:inplace id="email" editor="true">
									<p:inputText value="#{TemsilciBean.currentTemsilci.email}"
										required="true" requiredMessage="e-mail boş bırakılamaz" />
								</p:inplace>
								
								<h:outputText value="Tel1 : " />
								<p:inplace id="tel1" editor="true">
									<p:inputText value="#{TemsilciBean.currentTemsilci.tel1}"
										required="true" requiredMessage="Tel no boş bırakılamaz" />
								</p:inplace>
								
								<h:outputText value="Tel2 : " />
								<p:inplace id="tel2" editor="true">
									<p:inputText value="#{TemsilciBean.currentTemsilci.tel2}"
										required="true"/>
								</p:inplace>
								
								<h:outputText value="Fax : " />
								<p:inplace id="fax" editor="true">
									<p:inputText value="#{TemsilciBean.currentTemsilci.fax}"
										required="true" />
								</p:inplace>								
								
								<h:outputText value="Web Adresi : " />
								<p:inplace id="webadd" editor="true">
									<p:inputText value="#{TemsilciBean.currentTemsilci.kisiselWebAdd}" />
								</p:inplace>
							</h:panelGrid>
						</p:panel>
					</p:tab>
					
					<p:tab id="kullaniciInfo" title="Login info">
						<p:panel header="Login Information" id="klcInfo">

							<h:messages errorClass="error" 
								style="color: red; font-style: italic; text-decoration: blink"/>

							<h:panelGrid columns="3" columnClasses="label, value">
								<h:outputText value="Kullanıcı Adı: *" />
								<p:inputText required="true" label="kullaniciAdi"
									value="#{TemsilciBean.currentTemsilci.kullanici.kullaniciAdi}"
									disabled="true" style="color:red;"/>
								<h:outputText id="klcOut"
									value="Değiştirilemez" />
									
								<h:outputLabel for="pwd1" value="Password 1: *" />
								<p:password id="pwd1"
									value="#{TemsilciBean.currentTemsilci.kullanici.parola}"
									feedback="true" promptLabel="Lütfen şifre giriniz"
									weakLabel="Zayıf" goodLabel="Orta seviye" strongLabel="Güçlü"
									match="pwd2" label="Password 1" required="true"
									requiredMessage="Lütfen Parolanızı girin"
									validatorMessage="Parola tekrarı hatalı" />
								<h:outputText />

								<h:outputLabel for="pwd2" value="Parola tekrar: *" />
								<p:password id="pwd2"
									value="#{TemsilciBean.currentTemsilci.kullanici.parola}"
									label="Password 2"/>
								<h:outputText />
        					          					  	
							</h:panelGrid>
						</p:panel>
					</p:tab>
					<p:tab id="confirm" title="Confirmation">
						<p:panel header="Confirmation" >
							
							<h:panelGrid id="confirmation" columns="6">
								<h:panelGrid id="personalConfirmation" columns="2">
									<h:outputText value="Firma: " style="color:red" />
									<h:outputText styleClass="outputLabel"
										value="#{TemsilciBean.currentTemsilci.sirketprofil.firmaAd}" />

									<h:outputText value="Tc Kimlik: " style="color:red" />
									<h:outputText styleClass="outputLabel"
										value="#{TemsilciBean.currentTemsilci.tcKimlik}" />

									<h:outputText value="Ad: " />
									<h:outputText styleClass="outputLabel"
										value="#{TemsilciBean.currentTemsilci.ad}" />

									<h:outputText value="Soyad: " />
									<h:outputText styleClass="outputLabel"
										value="#{TemsilciBean.currentTemsilci.soyad}" />

									<h:outputText value="Doğum Tarihi: " />
									<h:outputText styleClass="outputLabel"
										value="#{TemsilciBean.currentTemsilci.dogumTarihi}" />

									<h:outputText value="Grup: " />
									<h:outputText styleClass="outputLabel" value="Temsilci" />
								</h:panelGrid>
																
								<h:panelGrid id="addressConfirmation" columns="2">
									<h:outputText value="İl: " />
									<h:outputText styleClass="outputLabel"
										value="#{TemsilciBean.currentTemsilci.adres.il}" />

									<h:outputText value="İlçe: " />
									<h:outputText styleClass="outputLabel"
										value="#{TemsilciBean.currentTemsilci.adres.ilce}" />

									<h:outputText value="Mahalle: " />
									<h:outputText styleClass="outputLabel"
										value="#{TemsilciBean.currentTemsilci.adres.mahalle}" />

									<h:outputText value="Sokak: " />
									<h:outputText styleClass="outputLabel"
										value="#{TemsilciBean.currentTemsilci.adres.sokak}" />

									<h:outputText value="Numara " />
									<h:outputText styleClass="outputLabel"
										value="#{TemsilciBean.currentTemsilci.adres.numara}" />
								</h:panelGrid>

								<h:panelGrid id="contactConfirmation" columns="2">
									<h:outputText value="Email: " />
									<h:outputText styleClass="outputLabel"
										value="#{TemsilciBean.currentTemsilci.email}" />

									<h:outputText value="Tel 1: " />
									<h:outputText styleClass="outputLabel"
										value="#{TemsilciBean.currentTemsilci.tel1}" />

									<h:outputText value="Tel 2: " />
									<h:outputText styleClass="outputLabel"
										value="#{TemsilciBean.currentTemsilci.tel2}" />

									<h:outputText value="Fax: " />
									<h:outputText styleClass="outputLabel"
										value="#{TemsilciBean.currentTemsilci.fax}" />

									<h:outputText value="Web Page: " />
									<h:outputText styleClass="outputLabel"
										value="#{TemsilciBean.currentTemsilci.kisiselWebAdd}" />
								</h:panelGrid>
								<h:outputText value="Kullanıcı Adı: " />
								<h:outputText styleClass="outputLabel"
									value="#{TemsilciBean.currentTemsilci.kullanici.kullaniciAdi}" />
							
							</h:panelGrid>
									
							<p:commandButton value="Kaydet" 
								update=":temsilciProDetay:temProDetayGrowl"
								actionListener="#{TemsilciBean.save}" 
								oncomplete="setTimeout('refreshPage();' , 3000);"/>

						</p:panel>
					</p:tab>
				</p:wizard>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>